package com.itmuch.cloud.study.entity;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import com.itmuch.cloud.study.controller.LoginController;

import java.util.Collection;


/**
 * 默认密码为空字符串  , 并且设置为启用,没有锁定 . 没有过期.
 */
public class JwtUser implements UserDetails {

    private  String username;
    private  String password;

    
    

	

	public void setUsername(String username) {
		this.username = username;
	}


	public JwtUser() {
		super();
		// TODO Auto-generated constructor stub
	}


	public void setPassword(String password) {
		this.password = password;
	}


	public JwtUser(
            String username
    ) {
        this.username = username;
     //   this.password = LoginController.loginpwd;
        this.password =LoginController.loginpwd;
//        this.authorities = authorities;
//        this.enabled = enabled;
//        this.lastPasswordResetDate = lastPasswordResetDate;
    }


	@Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public String getUsername() {
        return username;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }


}
